<?php 
/**
*	@package: sport
*	@subpackage: controller
*	@class: Upload
*	@description: upload controller
*	@author: Pham Van Diep
*	@date: 12/2/2014
**/

class Upload extends CI_Controller {
	public function __construct() {
		parent::__construct();
		$this->load->library('upload');
	}
	public function index() {
		// show form upload
		$this->smarty->assign('message','');
		$this->smarty->display('upload/form.tpl');
	}
	public function up() {	
		//Xu ly upload
		$info = $this->upload->upload('file');		
		if ( count($info) <= 0 ) {
			$this->smarty->assign('message',$this->upload->getErrorMessage());			
		}else{			
			$this->smarty->assign('message','');;
		}
		$this->smarty->display('upload/form.tpl');
		//$this->upload->cropImage( 'D:\dev\sport\uploads\2014\02\12\816674031bf9c727a1b0043e5e87eb00.1024x768.jpg',100,100);
		
	}
}
/** ***********************End of upload*************************** **/